<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>美策平台</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <link rel="stylesheet" type="text/css" href="../../datepicker/jquery-ui.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/app.css">
    <link rel="stylesheet" type="text/css" href="../../css/index.css">
    <script type="text/javascript" src="../../js/jquery.min.js"></script>
    <script type="text/javascript" src="/h5/js/all.js"></script>
</head>
<body>
<!--
    制作者：九哥
    页面：企业招聘简历详情页面
    时间：2019-03-01
-->





<!----------简历详情页面---------->
<div id="staffShowPage"><!--此ID页面切换用-->
    <div id="staffShowTitle">
        <b>简历详情</b>
        <img src="../../images/return.png" id="staffShowRtn">
    </div>
    <div id="staffShowIntro">
        <table>
            <tr>
                <td><b id="name"></b></td>
                <td rowspan="2" style="text-align:right" id="image"></td>
            </tr>
            <tr>
                <td><p id="sex">男·28岁·15190783028</p></td>
            </tr>
        </table>
    </div>
    <div style="height:15px;"></div>
    <div id="staffShowDetail">
        <p><b>基本信息</b></p>
        <table>
            <tr>
                <td class="left">最高学历</td>
                <td id="eduName" class="right"></td>
            </tr>
            <tr>
                <td class="left">体重</td>
                <td id="weight" class="right"></td>
            </tr>
            <tr>
                <td class="left">政治面貌</td>
                <td id="polity" class="right"></td>
            </tr>
            <tr>
                <td class="left">籍贯</td>
                <td id="nativePlace" class="right"></td>
            </tr>
            <tr>
                <td class="left">民族</td>
                <td id="nationality" class="right"></td>
            </tr>
            <tr>
                <td class="left">婚姻</td>
                <td id="marryName" class="right"></td>
            </tr>
            <tr>
                <td class="left">住宿情况</td>
                <td id="house" class="right"></td>
            </tr>
            <tr>
                <td class="left">身份证号码</td>
                <td id="idcard" class="right"></td>
            </tr>
            <tr>
                <td class="left">户口地址</td>
                <td id="householdAddress" class="right">
            </tr>
            <tr>
                <td class="left">紧急联系人</td>
                <td id="contactPerson" class="right"></td>
            </tr>
            <tr>
                <td class="left">期望薪资</td>
                <td class="right">8000元</td>
            </tr>
            <tr>
                <td class="left">期望薪资</td>
                <td class="right">8000元</td>
            </tr>
            <tr>
                <td class="left">专业技能</td>
                <td id="skill" class="right"></td>
            </tr>
            <tr>
                <td class="left">特长爱好</td>
                <td id="hobby" class="right"></td>
            </tr>
        </table>
        <!--<div style="height:10px;background:#f4f4f4;"></div>-->
        <!--<p><b>教育背景</b></p>-->
        <!--<table id="edu_bgs">-->
            <!--<tr>-->
                <!--<td class="left">毕业院校</td>-->
                <!--<td class="right">浙江财经大学</td>-->
            <!--</tr>-->
            <!--<tr>-->
                <!--<td class="left">起止时间</td>-->
                <!--<td class="right">2007.9&#45;&#45;2011.6</td>-->
            <!--</tr>-->
            <!--<tr>-->
                <!--<td class="left">专业</td>-->
                <!--<td class="right">计算机</td>-->
            <!--</tr>-->
            <!--<tr>-->
                <!--<td class="left">所获奖项</td>-->
                <!--<td class="right"></td>-->
            <!--</tr>-->
            <!--<tr>-->
                <!--<td class="left">民族</td>-->
                <!--<td class="right"></td>-->
            <!--</tr>-->
        <!--</table>-->
        <!--<div style="height:10px;background:#f4f4f4;"></div>-->
        <!--<p><b>家庭成员</b></p>-->
        <!--<table id=“familys>-->
            <!--<tr>-->
                <!--<td class="left">姓名</td>-->
                <!--<td class="right">李某某</td>-->
            <!--</tr>-->
            <!--<tr>-->
                <!--<td class="left">称谓</td>-->
                <!--<td class="right">父亲</td>-->
            <!--</tr>-->
            <!--<tr>-->
                <!--<td class="left">工作单位</td>-->
                <!--<td class="right">某某公司</td>-->
            <!--</tr>-->
            <!--<tr>-->
                <!--<td class="left">联系电话</td>-->
                <!--<td class="right">1505050550</td>-->
            <!--</tr>-->
        <!--</table>-->
        <!--<div style="height:10px;background:#f4f4f4;"></div>-->
        <!--<p><b>自我评价</b></p>-->
        <!--<table>-->
            <!--<tr>-->
                <!--<td class="left">自我评价</td>-->
                <!--<td class="right"></td>-->
            <!--</tr>-->
            <!--<tr>-->
                <!--<td class="left">擅长技能</td>-->
                <!--<td class="right"></td>-->
            <!--</tr>-->
            <!--<tr>-->
                <!--<td class="left">特长爱好</td>-->
                <!--<td class="right"></td>-->
            <!--</tr>-->
        <!--</table>-->
        <!--<div style="height:10px;background:#f4f4f4;"></div>-->
        <!--<p><b>业务类型</b></p>-->
        <!--<table>-->
            <!--<tr>-->
                <!--<td class="left">业务类型</td>-->
                <!--<td class="right">长期工</td>-->
            <!--</tr>-->
            <!--<tr>-->
                <!--<td class="left">技术等级</td>-->
                <!--<td class="right">中级</td>-->
            <!--</tr>-->
            <!--<tr>-->
                <!--<td class="left">工作经历</td>-->
                <!--<td class="right">-->
                    <!--多多理财是浙江多多互联网金融信息服务有限公司旗下 一家互联网金融信息服务平台,为用户提供汽车质押、供 应链金融等低风险高收益的-->
                <!--</td>-->
            <!--</tr>-->
        <!--</table>-->
        <!--企业操作按钮-->
        <!--1工人投递中，2企业拒绝投递，3企业面试邀请，4工人拒绝邀请，5面试中，-->
        <!--6面试失败，7面试成功，8工人评价，9企业评价，10完成-->
        <p class="submit">
            招聘流程状态：【<span id="statusName"></span>】
            <br><br>
            <button onclick="getTalk()">去交流</button>
            &nbsp; &nbsp;
            <button class="grey">已投递</button>
            <br><br>
            <span id="meet"></span>
            <br><br>
            <span id="finish"></span>
            <br><br>
            <span id="comment"></span>
        </p>
        <br><br><br>
    </div>
</div>
<!----------简历详情页面---------->





<!----------面试评价弹窗---------->
<div class="popComment">
    <div class="mask"></div>
    <div class="detail">
        <h2>面试评价</h2>
        <p>评价等级：</p>
        <p>
            <select id="level">
                <option value="1">差评</option>
                <option value="2">一般</option>
                <option value="3">好评评</option>
            </select>
        </p>
        <p>评价内容：</p>
        <p>
            <textarea id="commentDetail" cols="30" rows="10"></textarea>
        </p>
        <p>
            <button onclick="$('.popComment').hide()">取消</button>
            &nbsp;
            <button onclick="setCommentAdd()">保存</button>
        </p>
    </div>
</div>
<!----------面试评价弹窗---------->





<!----------错误提示---------->
<div id="errMsg"></div>
<!----------错误提示---------->
</body>
<script type="text/javascript" src="../../js/indexPageChange.js"></script>
<script type="text/javascript" src="../../js/index.js"></script>
<script>
    (function(){
        getShowList();
    })();
    //岗位列表
    function getShowList(){
        var userInfo = cacheGet('userInfo');
        var id = getUrlParam('staffJobId');
        var formData = {
            app_access:app_access,
            token:userInfo.token,
            id:id
        };
        $.ajax({
            type:'post',
            url:'/api/my/job/company/show',
            data:formData,
            success: function (res) {
                //console.log(res); return
                if (res.code!=0) {
                    getAppErrMsg(res.msg,'',2);
                    console.log(res);
                    return
                }
                console.log(res.data);
                var resData = res.data;
                var image = '<img src="../../images/toux01.png" width="50">';
                if (resData.image!='') {
                    image = '<img src="'+resData.image+'" width="50">';
                }
                $('#name').html(resData.name);
                $('#image').attr(image);
                $('#sexName').html(resData.sexName);
                $('#eduName').html(resData.eduName);
                $('#weight').html(resData.weight);
                $('#polity').html(resData.polity);
                $('#nativePlace').html(resData.nativePlace);
                $('#nationality').html(resData.nationality);
                $('#marryName').html(resData.marryName);
                $('#house').html(resData.house);
                $('#idcard').html(resData.idcard);
                $('#householdAddress').html(resData.householdAddress);
                $('#contactPerson').html(resData.contactPerson);
                $('#skill').html(resData.skill);
                $('#hobby').html(resData.hobby);
                //招聘状态
                var status = resData.status;
                var statuss = resData.statuss;
                $('#statusName').html(statuss[status]);
                //按钮判断
//                1工人投递中，2企业拒绝投递，3企业面试邀请，4工人拒绝邀请，5面试中，
//                6面试失败，7面试成功，8工人评价，9企业评价，10完成
                var meet = '', finish = '', comment = '';
                if (status==1) {
                    meet += '<button class="grey">拒绝投递</button>';
                    meet += ' &nbsp; &nbsp; ';
                    meet += '<button class="grey">邀请面试</button>';
                    finish += '<button class="grey">面试失败</button>';
                    finish += ' &nbsp; &nbsp; ';
                    finish += '<button class="grey">面试成功</button>';
                    comment += '<button class="grey">待评价</button>';
                    $('#meet').html(meet);
                    $('#finish').html(finish);
                    $('#comment').html(comment);
                } else if (status==3) {
                    meet += '<button onclick="setMeet(1)">拒绝投递</button>';
                    meet += ' &nbsp; &nbsp; ';
                    meet += '<button onclick="setMeet(2)">邀请面试</button> ';
                    finish += '<button class="grey">面试失败</button>';
                    finish += ' &nbsp; &nbsp; ';
                    finish += '<button class="grey">面试成功</button>';
                    comment = '<button class="grey">待评价</button>';
                    $('#meet').html(meet);
                    $('#finish').html(finish);
                    $('#comment').html(comment);
                } else if (status==5) {
                    meet += '<button class="grey">拒绝投递</button>';
                    meet += ' &nbsp; &nbsp; ';
                    meet += '<button class="grey">邀请面试</button>';
                    finish += '<button onclick="setFinish(1)">面试成功</button>';
                    finish += ' &nbsp; &nbsp; ';
                    finish += '<button onclick="setFinish(2)">面试失败</button> ';
                    comment = '<button class="grey">待评价</button>';
                    $('#meet').html(meet);
                    $('#finish').html(finish);
                    $('#comment').html(comment);
                } else if (status==7) {
                    meet += '<button class="grey">拒绝投递</button>';
                    meet += ' &nbsp; &nbsp; ';
                    meet += '<button class="grey">邀请面试</button>';
                    finish += '<button class="grey">面试失败</button>';
                    finish += ' &nbsp; &nbsp; ';
                    finish += '<button class="grey">面试成功</button>';
                    comment = '<button class="grey">去评价</button>';
                    $('#meet').html(meet);
                    $('#finish').html(finish);
                    $('#comment').html(comment);
                } else if (status==8) {
                    meet += '<button class="grey">拒绝投递</button>';
                    meet += ' &nbsp; &nbsp; ';
                    meet += '<button class="grey">邀请面试</button>';
                    finish += '<button class="grey">面试失败</button>';
                    finish += ' &nbsp; &nbsp; ';
                    finish += '<button class="grey">面试成功</button>';
                    comment = '<button onclick="setCommet()">去评价</button>';
                    $('#meet').html(meet);
                    $('#finish').html(finish);
                    $('#comment').html(comment);
                } else if (status==9) {
                    meet += '<button class="grey">拒绝投递</button>';
                    meet += ' &nbsp; &nbsp; ';
                    meet += '<button class="grey">邀请面试</button>';
                    finish += '<button class="grey">面试失败</button>';
                    finish += ' &nbsp; &nbsp; ';
                    finish += '<button class="grey">面试成功</button>';
                    comment = '<button class="grey">已评价</button>';
                    comment += ' &nbsp; &nbsp; ';
                    comment += '<button onclick="getComment()">获取评价</button>';
                    $('#meet').html(meet);
                    $('#finish').html(finish);
                    $('#comment').html(comment);
                }
            }
        });
    }
    //去交流
    function getTalk(){
        var cid = $('#cid').val();
        var userInfo = cacheGet('userInfo');
        var jobId = getUrlParam('staffJobId');
        var formData = {
            app_access:app_access,
            token:userInfo.token,
            uid2:cid,
            job:jobId
        };
        $.ajax({
            type:'post',
            url:'/api/msg/add',
            data:formData,
            success: function (res) {
                //console.log(res); return
                if (res.code!=0) {
                    getAppErrMsg(res.msg,'',2);
                    console.log(res);
                    return
                }
                var resData = res.data;
//                console.log(resData);
                var talkId = resData.talkId;
                var own = resData.own;
                var other = resData.other;
                var otherName = resData.otherName;
                var jobId = resData.jobId;
                var prefix = '?id='+talkId+'&own='+own+'&other='+other+'&otherName='+otherName+'&jobId='+jobId;
                window.location.href = '/h5/message/jobWin.html'+prefix;
            }
        });
    }
    /**
     * 设置面试邀请
     * 1拒绝投递，2邀请面试
     * */
    function setMeet(v){
        var userInfo = cacheGet('userInfo');
        var jobId = getUrlParam('staffJobId');
        var formData = {
            app_access:app_access,
            token:userInfo.token,
            job:jobId,
            meet:v
        };
        $.ajax({
            type:'post',
            url:'/api/my/job/meet-set',
            data:formData,
            success: function (res) {
                //console.log(res); return
                if (res.code!=0) {
                    getAppErrMsg(res.msg,'',0);
                    console.log(res);
                    return
                }
                getAppErrMsg(res.msg,'',0);
                console.log(res);
                setTimeout(function(){
                    window.location.href = '';
                }, 1000*2);
            }
        });
    }
    /**
     * 设置完成
     * 1面试失败，2面试成功
     * */
    function setFinish(v){
        var userInfo = cacheGet('userInfo');
        var jobId = getUrlParam('staffJobId');
        var formData = {
            app_access:app_access,
            token:userInfo.token,
            job:jobId,
            finish:v
        };
        $.ajax({
            type:'post',
            url:'/api/my/job/finish-set',
            data:formData,
            success: function (res) {
                //console.log(res); return
                if (res.code!=0) {
                    getAppErrMsg(res.msg,'',0);
                    console.log(res);
                    return
                }
                getAppErrMsg(res.msg,'',0);
                console.log(res);
                setTimeout(function(){
                    window.location.href = '';
                }, 1000*2);
            }
        });
    }
    //显示评价
    function setComment(){
        $('.popComment').show();
    }
    //设置评价
    function setCommentAdd(){
        var userInfo = cacheGet('userInfo');
        var jobId = getUrlParam('staffJobId');
        var level = $('#level').val();
        var detail = $('#commentDetail').val();
        if (!level || !detail) {
            getAppErrMsg('信息不全！','',0);
            return
        }
        var formData = {
            app_access:app_access,
            token:userInfo.token,
            job:jobId,
            level:level,
            detail:detail
        };
//        console.log(formData); return
        $.ajax({
            type:'post',
            url:'/api/my/job/recruit/comment-set',
            data:formData,
            success: function (res) {
                //console.log(res); return
                if (res.code!=0) {
                    getAppErrMsg(res.msg,'',0);
                    console.log(res);
                    return
                }
                getAppErrMsg(res.msg,'',0);
                console.log(res);
                setTimeout(function(){
                    window.location.href = '';
                }, 1000*2);
            }
        });
    }
    //获取评价
    function getComment(){
//        getAppErrMsg('待接入！','',0)
        var userInfo = cacheGet('userInfo');
        var jobId = getUrlParam('staffJobId');
        var formData = {
            app_access:app_access,
            token:userInfo.token,
            job:jobId
        };
        $.ajax({
            type:'post',
            url:'/api/my/job/recruit/comment-get',
            data:formData,
            success: function (res) {
                //console.log(res); return
                var comment = '';
                if (res.code!=0) {
                    comment += '<button onclick="setComment()">待评价</button>';
                    comment += ' &nbsp; &nbsp; ';
                    comment += '<button class="grey">完成</button>';
                    $('#comment').html(comment);
                    console.log(res);
                    return
                }
                comment += '<button class="grey">已评价</button>';
                comment += ' &nbsp; &nbsp; ';
                comment += '<button class="grey">完成</button>';
                $('#comment').html(comment);
            }
        });
    }
</script>
</html>